﻿using EFModel;
using IServices;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using xm.Controllers;
using Y2.Filters;

namespace Y2.Controllers
{
    [LoginFilter]
    public class salary_grantToController : Controller
    {
        private readonly Isalary_grant he;

        public salary_grantToController(Isalary_grant he)
        {
            this.he = he;
        }
        public IActionResult salary_grantTo()
        {
            return View();
        }
        public IActionResult salary_grantToUpdate(string id)
        {        
            ViewBag.salary_grant_id =id;
            return View();
        }
        //薪酬发放未复核查询
        public async Task<IActionResult> Tofe(int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.Tofe(currentPage, pageSize)));
        }
        //薪酬发放编号查询薪酬发放表
        public async Task<string> Cux(string id)
        {
            return await he.Cux(id);
        }
        //薪酬发放编号查询薪酬详细表
        public async Task<string> CuxTo(string id)
        {
            return await he.CuxTo(id);
        }
        //薪酬编号查询人力资源表
        public async Task<string> ChaX()
        {
            return await he.ChaX();
        }
        //薪酬发放详细修改
        public Task<int> Update(salary_grant_details salary_)
        {
            return he.Update(salary_);
        }
        //人力资源金额修改，状态修改
        public Task<int> UpdateTo(human_file _File)
        {
            return he.UpdateTo(_File);
        }
        //薪酬发放修改
        public async Task<int> UpdateSe(salary_grant salary_)
        {
            return await he.UpdateSe(salary_);
        }
    }
}
